package tree;

import linearlist.Queue;

import java.util.List;

/**
 * @Author Zhouchb
 * @Create 2021-10-2021/10/27 :20:04
 * @Description
 */
public class BinaryTreeTest2 {
    public static void main(String[] args) {
        BinaryTree<Integer, Integer> binaryTree = new BinaryTree<>();

        binaryTree.put(5,5);
        binaryTree.put(2,2);
        binaryTree.put(7,7);
        binaryTree.put(1,1);
        binaryTree.put(4,4);
        binaryTree.put(6,6);
        binaryTree.put(8,8);
        binaryTree.put(3,3);
        System.out.println("前序遍历");
        List<Integer> preList = binaryTree.preErgodic();
        int size = preList.size();
        for (Integer s : preList) {
            System.out.print(s);
            if (--size!=0){
                System.out.print("-");
            }
        }
        System.out.println();
        System.out.println("树的最大深度");
        int i = binaryTree.maxDepth();
        System.out.println(i);

    }
}
